package com.zz.common.exception;

import com.zz.common.base.enums.BaseExceptionEnum;

/**
 * @author zl
 * @version 1.0
 */
public class BaseException extends RuntimeException {

    private final String code;
    private final String message;

    public BaseException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public BaseException(BaseExceptionEnum baseExceptionEnum) {
        this(baseExceptionEnum.getCode(), baseExceptionEnum.getMessage());
    }

    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
